home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qpakwin.zip / INSTALL.EXE / PLAY.DOC < prev    next >
Text File  |  1991-10-30  |  3KB  |  90 lines

  1.    Play uses the same script strings supported by the PLAY statement
  2.    in regular Microsoft BASIC.
  3.  
  4.    Play supports the following basic notation:
  5.     
  6.       Letter notes "A" through "G" in upper or lower case
  7.       Optional "+" or "#" suffix to indicate a musical Sharp
  8.       Optional "-" suffix to indicate a musical Flat
  9.       Optional numeric suffix to override a note's duration
  10.  
  11.          Example: "c#16 g- c"
  12.  
  13.  
  14.       Tempo in the range of 32 through 255
  15.  
  16.          Example: "t155 bbb8 bbb8"
  17.          Default: "t120"
  18.  
  19.       Length of each note in the range of 1 through 64
  20.  
  21.          Example: "l16 bbb8 bbb8"
  22.          Default: "l4"
  23.  
  24.       Octave in the range of 0 through 6
  25.  
  26.          Example: "o2 ggg P32 e-4"
  27.          Default: "o4"
  28.  
  29.       Octave Up and Down "<" and ">" symbols
  30.  
  31.          Example: "cdefgab<c  c>bagfedc"
  32.  
  33.       Music Normal, Staccato, Legato modifiers
  34.  
  35.          Example: "mn c ms d ml l32ef"
  36.          Default: "mn"
  37.  
  38.          Note: BASIC's "MF" and "MB" have no effect and are ignored.
  39.  
  40.       Pause (rest) for a duration 1 through 64
  41.  
  42.          Example: "l8 ggg p32 e-4"
  43.  
  44.       Numeric notes in the range of 0 through 84
  45.  
  46.          Example: "n55 n56 n57 n0 n58"
  47.          Note that a note value of zero ("n0") is a rest.
  48.  
  49. The following statements play "On top of old smokey".  Note that these
  50. multiple statements should be combined into a single long string for
  51. code efficiency.  This example is shown in portions for ease of commenting.
  52. Also note that extra spaces are ignored by the Play function and are used
  53. here solely for clarity.
  54.  
  55.    Status = Play%("t180 l4")  'tempo = 180, note length = 4
  56.    Status = Play%("o3 ms")    'octave = 3, music = staccato
  57.    Status = Play%("cceg")     'the first four notes
  58.    Status = Play%("> c2")     'up an octave, play C as a half note
  59.    Status = Play%("< a2")     'octave back down, A is a half note
  60.    Status = Play%("afgag1")   'the last note here is a whole note
  61.  
  62.  
  63. Comments:
  64.  
  65.    This function requires that the Windows sound driver SOUND.DRV
  66.    supplied with QuickPak Professional for Windows be installed in
  67.    your Windows system directory.  The driver supplied with this
  68.    package is an updated version of the one supplied with Windows 3.0,
  69.    and you may distribute it with your applications.
  70.  
  71.    Since the Windows sound driver cannot accept a new Play string when
  72.    it is busy executing a previous script, you must create code to check
  73.    the driver's status as follows:
  74.  
  75.       Do Until Play%(Tune$)
  76.          Dummy% = DoEvents%()
  77.       Loop
  78.  
  79.    This example continually tries to execute the script contained in
  80.    Tune$ until the Play function returns a non-zero result.  A return
  81.    status other than zero indicates that the music was accepted by the
  82.    sound driver, or an error occured preventing any music from being
  83.    played.  The DoEvents%() statement ensures that other Windows tasks
  84.    are able to execute while you are waiting for the sound driver to
  85.    complete the script.
  86.  
  87.  
  88.  
  89.  
  90.